package priv.abadstring.study.haoke.webapi.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import priv.abadstring.study.haoke.webapi.interceptor.RedisCacheInterceptor;

/**
 * InterceptorConfiguration
 *
 * @author aBadString
 * @date 2021-07-29 17:40:09
 */
@Configuration
public class InterceptorConfiguration implements WebMvcConfigurer {
    @Autowired
    private RedisCacheInterceptor redisCacheInterceptor;
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(redisCacheInterceptor).addPathPatterns("/**");
    }
}
